import Vue from 'vue'
import Vuex from 'vuex'
import { IAppState } from './modules/app'
import { IUserState } from './modules/user'
import { IPermissionState } from './modules/permission'
import createLoadingPlugin from '@/utils/vuex-loading'

Vue.use(Vuex)

export interface IRootState {
  app: IAppState
  user: IUserState
  permission: IPermissionState
}

export default new Vuex.Store<IRootState>({
  plugins: [createLoadingPlugin()]
})
